OpenGL: calibration loop when context is created#1396
Conversation
|
(as it is, my draft makes |
|
@slomp sure let me give this a try. |
|
As a side note, I'm not entirely sure how the gpu timer works, but in our game/this binary the simulation is running on the same thread as the opengl draw calls - so the gpu is frequently without work while the simulation is running (possible downclocking to idle?). I wonder if running at lower utilization like this results in more drift. Also I would guess that the original synchronization is happening during initial game load/load screen, where draw calls are not happening much at all (so, again an idle gpu). Perhaps that is what's causing the initial major drift? |
|
|
|
ok sorry should be good to go now. It did indeed seem to improve (but not fix) the drift, anecdotally. |
|
Thanks for running the experiment! I'll keep this draft around and try to run some experiments myself. It must be noted that the way that CPU and GPU timestamps are correlated will always skew the correlation in such a way that the GPU time is always behind the CPU: tracy/public/tracy/TracyOpenGL.hpp Lines 216 to 217 in 7ee4380 I kept the same strategy in this draft in order to "control the variables", but in case you're curious, you could try uncommenting the "mid-point" approach to see if it is more accurate: tracy/public/tracy/TracyOpenGL.hpp Lines 239 to 240 in 5240b96 I'll ping you again once I can find some cycles to resume work on this draft. |
|
sounds good, pretty easy for me to test, so just let me know. |


I was a bit late for this discussion #1393, but I think we can minimize drift substantially with a better cpu-gpu clock calibration upfront, when the context is created.
@bruno-dasilva Would you be able to give this branch a try, without toggling
TRACY_OPENGL_AUTO_CALIBRATIONto see if your drift problems go away?Assuming all goes well, we could consider increasing the Recalibration period to, say, 10s when
TRACY_OPENGL_AUTO_CALIBRATIONis enabled (or rather, let the user specify the recalibration period as the value ofTRACY_OPENGL_AUTO_CALIBRATION).